home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Peter Lewis / PNL Libraries / MyMathUtils.p < prev    next >
Encoding:
Text File  |  1994-02-16  |  918 b   |  59 lines  |  [TEXT/PJMM]

  1. unit MyMathUtils;
  2.  
  3. interface
  4.  
  5.     function Min (a, b: longInt): longInt;
  6.     inline
  7.         $201F, $2E9F, $B097, $6C02, $2E80;
  8.  
  9.     function Max (a, b: longInt): longInt;
  10.     inline
  11.         $201F, $2E9F, $B097, $6F02, $2E80;
  12.  
  13.     function Pin (a, b, c: longInt): longInt;
  14.     inline
  15.         $201F, $221F, $B280, $6F02, $2200, $201F, $B280, $6C02, $2200, $2E81;
  16.  
  17.     function Choose (cond: boolean; a, b: longInt): longInt;
  18.     inline
  19.         $201F, $221F, $4A1F, $6602, $2200, $2E81;
  20.  
  21. implementation
  22.  
  23. end.
  24.  
  25. function Max (a, b: longInt): longInt;
  26. begin
  27.     if a > b then
  28.         Max := a
  29.     else
  30.         Max := b;
  31. end;
  32.  
  33. function Min (a, b: longInt): longInt;
  34. begin
  35.     if a < b then
  36.         Min := a
  37.     else
  38.         Min := b;
  39. end;
  40.  
  41. function Pin (a, b, c: longInt): longInt;
  42. begin
  43.     if b < a then
  44.         Pin := a
  45.     else if b > c then
  46.         Pin := c
  47.     else
  48.         Pin := b;
  49. end;
  50.  
  51. function Choose (cond: boolean; a, b: longInt): longInt;
  52. begin
  53.     if cond then begin
  54.         Choose := a;
  55.     end
  56.     else begin
  57.         Choose := b;
  58.     end;
  59. end;